package com.sxbang.friday.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

@Data//不需要写get/set方法
@EqualsAndHashCode(callSuper = true)
public class SysUser extends BaseEntity<Long> {
    private static final long serialVersionUID = -6525908145032868837L;
    private String username;
    private String password;
    private String nickname;
    private String headImgUrl;
    private String phone;
    private String telephone;
    private String email;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date birthday;
    private Integer sex;
    private Integer status;

    public SysUser() {
    }

/*    public SysUser(long id, String username, String password, String nickname, String headImgUrl, String phone, String telephone, String email, Date birthday, Integer sex, Integer status) {
        super.setId(id);
        this.username = username;
        this.password = password;
        this.nickname = nickname;
        this.headImgUrl = headImgUrl;
        this.phone = phone;
        this.telephone = telephone;
        this.email = email;
        this.birthday = birthday;
        this.sex = sex;
        this.status = status;
    }*/

    public SysUser(String username, String password, String nickname, String headImgUrl, String phone, String telephone, String email, Date birthday, Integer sex, Integer status) {
        this.username = username;
        this.password = password;
        this.nickname = nickname;
        this.headImgUrl = headImgUrl;
        this.phone = phone;
        this.telephone = telephone;
        this.email = email;
        this.birthday = birthday;
        this.sex = sex;
        this.status = status;
    }

/*    @Override
    public String toString() {
        return "SysUser{" +
                "id='" + this.getId() + '\'' +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", nickname='" + nickname + '\'' +
                ", headImgUrl='" + headImgUrl + '\'' +
                ", phone='" + phone + '\'' +
                ", telephone='" + telephone + '\'' +
                ", email='" + email + '\'' +
                ", birthday=" + birthday +
                ", sex=" + sex +
                ", status=" + status +
                ", createTime=" + this.getCreateTime() +
                ", updateTime=" + this.getUpdateTime() +
                '}';
    }*/
    @Override
    public String toString() {
        return "SysUser{" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", nickname='" + nickname + '\'' +
                ", headImgUrl='" + headImgUrl + '\'' +
                ", phone='" + phone + '\'' +
                ", telephone='" + telephone + '\'' +
                ", email='" + email + '\'' +
                ", birthday=" + birthday +
                ", sex=" + sex +
                ", status=" + status +
                '}';
    }
    public interface Status {
        int DISABLED = 0;
        int VALID = 1;
        int LOCKED = 2;
    }

}
